import { request } from '@/utils/http';

/**
 * 获取验证码
 * @param params
 */
export function getCode(params: object) {
    return request.Post('/api/sms/send', params);
}

/**
 * 手机号登录
 * @param params
 */
export function mobileLogin(params: object) {
    return request.Post('/api/user/mobilelogin', params);
}

/**
 * 小程序手机号登录
 * @param params
 */
export function wxmobileLogin(params: object) {
    return request.Post('/api/user/wxmobilelogin', params);
}

/**
 * 首页数据
 * @param params
 */
export function homeData() {
    return request.Post('/api/index/index');
}
/**
 * 首页数据
 * @param params
 */
export function homeAsset(params: object) {
    return request.Post('/api/index/asset', params);
}
/**
 * 轮播图详情
 * @param params
 */
export function bannerDetail(params: object) {
    return request.Get('/api/banner/detail', { params });
}

/**
 * 公告列表
 * @param params
 */
export function noticeList(params: object) {
    return request.Post('/api/notice/list', params);
}

/**
 * 公告详情
 * @param params
 */
export function noticeDetail(params: object) {
    return request.Get('/api/notice/detail', { params });
}

/**
 * 推介会详情
 * @param params
 */
export function marketingDetail(params: object) {
    return request.Get('/api/marketing/detail', { params });
}

/**
 * 服务列表
 * @param params
 */
export function serviceList(params: object) {
    return request.Post('/api/service/list', params);
}

/**
 * 资产列表
 * @param params
 * @returns
 */
export function assetList(params: object) {
    return request.Post('/api/asset/list', params);
}

/**
 * 资产详情
 * @param params
 * @returns
 */
export function assetDetail(params: object) {
    return request.Get('/api/asset/detail', { params });
}

/**
 * 资产类型
 * @returns
 */
export function typeList() {
    return request.Post('/api/type/select');
}

/**
 * 标的物类型
 * @returns
 */
export function subjectTypeList(params: object) {
    return request.Post('/api/subject_type/select', params);
}

/**
 * 标签
 * @returns
 */
export function tagList(params: object) {
    return request.Post('/api/tag/select', params);
}

/**
 * 处置机构
 * @returns
 */
export function organList(params: object) {
    return request.Post('/api/organ/list', params);
}

/**
 * 贷款配置添加
 * @param params
 */
export function loansAdd(params: object) {
    return request.Post('/api/loans/add', params);
}
/**
 * 提交置换意向
 * @param params
 * @returns
 */
export function assetIntentAdd(params: object) {
    return request.Post('/api/asset_intent/add', params);
}

export function assetIntentDetail(params: object) {
    return request.Get('/api/asset_intent/detail', { params });
}
/**
 * 置换规则
 */
export function barterRule() {
    return request.Post('/api/index/barter_rule');
}
/**
 * 置换发布
 */
export function barterAdd(params: object) {
    return request.Post('/api/barter/add', params);
}
/**
 * 置换类型
 */
export function barterTypeList() {
    return request.Post('/api/barter_type/select');
}
/**
 * 置换列表
 * @param params
 * @returns
 */
export function barterList(params: object) {
    return request.Post('/api/barter/list', params);
}
/**
 * 置换详情
 * @param params
 * @returns
 */
export function barterDetail(params: object) {
    return request.Get('/api/barter/detail', { params });
}
/**
 * 收藏
 */
export function barterCollect(params: object) {
    return request.Post('/api/barter/collect', params);
}
/**
 * 收藏
 */
export function assetCollect(params: object) {
    return request.Post('/api/asset/collect', params);
}
/**
 * 提交置换意向
 * @returns
 */
export function barterIntentAdd(params: object) {
    return request.Post('/api/barter_intent/add', params);
}
/**
 * 置换意向详情
 * @param params
 * @returns
 */
export function barterIntentDetail(params: object) {
    return request.Get('/api/barter_intent/detail', { params });
}
/**
 * 获取用户信息
 * @returns
 */
export function getUserInfo() {
    return request.Post('/api/user/index');
}
/**
 * 用户信息修改
 * @param params
 * @returns
 */
export function userEdit(params: object) {
    return request.Post('/api/user/profile', params);
}
/**
 * 经纪人注册
 * @param params
 * @returns
 */
export function brokerAdd(params: object) {
    return request.Post('/api/broker/add', params);
}
/**
 * 经纪人详情
 * @param params
 */
export function brokerDetail(params: object) {
    return request.Get('/api/broker/detail', { params });
}
/**
 * 收藏列表
 * @param params
 * @returns
 */
export function favoritesList(params: object) {
    return request.Put('/api/favorites/list', params);
}
/**
 * 浏览记录
 * @param params
 * @returns
 */
export function browsingList(params: object) {
    return request.Put('/api/browsing/list', params);
}
/**
 * 意见反馈
 * @param params
 * @returns
 */
export function feedbackAdd(params: object) {
    return request.Post('/api/feedback/add', params);
}
/**
 * 消息列表
 * @param params
 * @returns
 */
export function messageList(params: object) {
    return request.Put('/api/message/list', params);
}
/**
 * 消息详情
 * @param params
 * @returns
 */
export function messageDetail(params: object) {
    return request.Get('/api/message/detail', { params });
}
/**
 * 置换大厅Banner
 * @returns
 */
export function barterBanner() {
    return request.Get('/api/index/barter_banner');
}
/**
 * 我的资产
 * @returns
 */
export function userBarterList(params: object) {
    return request.Put('/api/barter/userlist', params);
}
/**
 * 下架
 * @param params
 * @returns
 */
export function bannerSoldout(params: object) {
    return request.Post('/api/barter/soldout', params);
}
/**
 * 资产编辑
 * @param params
 * @returns
 */
export function barterEdit(params: object) {
    return request.Post('/api/barter/edit', params);
}
/**
 * 意向列表
 * @param params
 * @returns
 */
export function intentList(params: object) {
    return request.Put('/api/intent/list', params);
}

/**
 * 经纪人注册协议
 */
export function brokerAgreement() {
    return request.Get('/api/index/broker_agreement');
}
/**
 * 置换审核未通过
 * @returns
 */
export function barterAuditData() {
    return request.Get('/api/barter/getAuditData', { localCache: 0 });
}
/**
 * 置换协议
 */
export function barterAgreement() {
    return request.Get('/api/index/barter_agreement');
}
export function privacyAgreement() {
    return request.Get('/api/index/privacy_agreement');
}
/**
 * 视频封面
 * @returns
 */
export function getVideoCover() {
    return request.Get('/api/index/videocover');
}
